package com.zycfc.zsf.boot.util.bean;

import org.apache.commons.lang3.*;

public abstract class BooleanMoreUtils
{
    public static boolean toBoolean(final String str) {
        return Boolean.parseBoolean(str);
    }
    
    public static Boolean toBooleanObject(final String str) {
        return (str != null) ? Boolean.valueOf(str) : null;
    }
    
    public static Boolean toBooleanObject(final String str, final Boolean defaultValue) {
        return (str != null) ? Boolean.valueOf(str) : defaultValue;
    }
    
    public static Boolean parseGeneralString(final String str) {
        return BooleanUtils.toBooleanObject(str);
    }
    
    public static Boolean parseGeneralString(final String str, final Boolean defaultValue) {
        return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), (boolean)defaultValue);
    }
    
    public static boolean negate(final boolean bool) {
        return !bool;
    }
    
    public static Boolean negate(final Boolean bool) {
        return BooleanUtils.negate(bool);
    }
    
    public static boolean and(final boolean... array) {
        return BooleanUtils.and(array);
    }
    
    public static boolean or(final boolean... array) {
        return BooleanUtils.or(array);
    }
    
    public static int compare(final boolean x, final boolean y) {
        return BooleanUtils.compare(x, y);
    }
}
